package com.bdqn.t382.lx.pojo;

import com.bdqn.t382.lx.mapper.AnimalsMapper;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Page implements Serializable {
    private Integer pageNo = 1;  // 当前页码
    private Integer pageSize = 2;  // 每页显示的数据行数
    private Integer totalCount;  //总的记录数
    private Integer totalPageCount; //总页数
    private List<BookManage> list = new ArrayList<>();
    private List<Animals> anList = new ArrayList<>();

    public Page(Integer pageNo, Integer pageSize, Integer totalCount, Integer totalPageCount, List<BookManage> list, List<Animals> anList) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.totalCount = totalCount;
        this.totalPageCount = totalPageCount;
        this.list = list;
        this.anList = anList;
    }

    public Page() {

    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
        // 计算总页数
        if (this.totalCount % pageSize == 0) {
            this.totalPageCount = this.totalCount / pageSize;
        } else {
            this.totalPageCount = (this.totalCount / pageSize) + 1;
        }
    }

    public Integer getTotalPageCount() {
        return totalPageCount;
    }

    public void setTotalPageCount(Integer totalPageCount) {
        this.totalPageCount = totalPageCount;
    }

    public List<BookManage> getList() {
        return list;
    }

    public void setList(List<BookManage> list) {
        this.list = list;
    }

    public List<Animals> getAnList() {
        return anList;
    }

    public void setAnList(List<Animals> anList) {
        this.anList = anList;
    }
}
